﻿var status = 0;




function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {

    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)                           						
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendSimple ("#e親愛的玩家#h #\r\n#e請問需要購買甚麼裝備呢?#r\r\n"+
           "#L0#戰士武器"+
           "\r\n#L1#戰士防具"+
           "\r\n#L2#惡魔復仇者武器"+
           "\r\n#L3#神之子武器"+
           "\r\n#L4#米哈義武器"+
           "\r\n#L5#凱薩武器"+
           "\r\n#L6#劍豪武器");
        } else if (status == 1) {
            if (selection == 0) {
                cm.dispose();
                cm.openShop(10);
       } else if (selection == 1) {
                cm.dispose();
                cm.openShop(11);
       } else if (selection == 2) {
                cm.dispose();
                cm.openShop(307);
       } else if (selection == 3) {
                cm.dispose();
                cm.openShop(65);
       } else if (selection == 4) {
                cm.dispose();
                cm.openShop(321);
       } else if (selection == 5) {
                cm.dispose();
                cm.openShop(323);
       } else if (selection == 6){
                cm.dispose();
                cm.openShop(10);
		} else if (selection == 7) {
		cm.dispose();
		cm.warp(689010000, 0);
        } else if (selection == 8) {
		cm.dispose();
		cm.warp(551030100, 0);
		} else if (selection == 9) {
		cm.dispose();
		cm.warp(800040410, 0);
		} else if (selection == 10){
		cm.dispose();
		cm.warp(230040420, 0); 
		} else if (selection == 11){
		cm.dispose();
		cm.warp(105100100, 0);
		} else if ( selection == 12){
		cm.dispose();
		cm.warp(211042400, 0);
		} else if ( selection == 13){
		cm.dispose();
		cm.warp(401060000, 0);
		} else if ( selection == 14){
		cm.dispose();
		cm.warp(211041700, 0);
		} else if ( selection == 15){
		cm.dispose();
		cm.warp(105200000, 0);
		} else if ( selection == 16){
		cm.dispose();
		cm.warp(911005901, 0);
		return;
}
}
        }
    }
